
<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
  <meta name="description" content="xms">
  <meta name="author" content="Xms">
  <link rel="icon" href="/content/favicon.ico">

  <title>系统 - 参数设置 - 系统参数</title>

  <!-- Bootstrap core CSS -->
  <link href="/content/css/bootstrap3.3.5/bootstrap.min.css" rel="stylesheet">

  <!-- Custom styles for this template -->
  <link href="/content/css/font-awesome.min.css" rel="stylesheet">
  <link href="/content/css/common.css" rel="stylesheet">
  <link href="/content/js/jquery-toast/jquery.toast.min.css" rel="stylesheet">
  <link id="themeLink" href="/content/css/theme/default.css" rel="stylesheet" />
  <!-- Bootstrap core JavaScript ================================================== -->
  <!-- Placed at the end of the document so the pages load faster -->
  <script src="/content/js/jquery.min.js"></script>
  <script src="/content/js/bootstrap.min.js"></script>
  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
  <script src="/content/js/ie10-viewport-bug-workaround.js"></script>
  <script src="/content/js/jquery.bootstrap.min.js"></script>
  <script src="/content/js/json2.js"></script>
  <script src="/content/js/xms.utility.js"></script>
  <script src="/content/js/jquery-ui-1.10.3/ui/jquery.ui.core.js"></script>
  <script src="/content/js/jquery-ui-1.10.3/ui/jquery.ui.widget.js"></script>
  <script src="/content/js/jquery-ui-1.10.3/ui/jquery.ui.mouse.js"></script>
  <script src="/content/js/jquery-ui-1.10.3/ui/jquery.ui.draggable.js"></script>
  <script src="/content/js/jquery-toast/jquery.toast.min.js"></script>
  <script src="/content/js/xms.jquery.js"></script>
  <script src="/content/js/xms.web.js"></script>
  <script src="/content/js/xms.page.js"></script>
  <script src="/content/js/commonlabels.js"></script>
  <script src="/content/js/common/pagecontext.js"></script>
  <script src="/api/user/usercontext"></script>
  <style>
  body {
    padding-top: 0;
  }
</style>
</head>

<body data-spy="scroll" data-target="#myScrollspy">
<div class="container-fluid" id="body">
  <div class="row">
    <div class="shadeBox" style="background-color:#000000; opacity:0.5;width:100%;position:absolute;z-index:10;display:none;"></div>
    <div class="col-md-12" id="main" style="margin-bottom:80px;">
      <div><br class="breadcrumb" /></div>
      <div id="content"></div>
      <div class="page-render-wrap">
        <!--main-->

        <div class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">
              <a data-toggle="collapse"
                 href="#collapseTwo">
                <strong>系统参数</strong>
              </a>
            </h3>
          </div>
          <div class="panel-body">
            <form id="editform" class="form-horizontal" data-jsonajax="true" data-formdata="false"
                  data-istip="true" action="/xms/api/settings/platform/save" method="post">
              <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="AppName">应用名称</label>
                <div class="col-sm-10">
                  <input class="form-control required" id="AppName" name="appname" data-name="appname" type="text" />
                </div>
              </div>
              <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="AppVersion">版本号</label>
                <div class="col-sm-10">
                  <input class="form-control required" id="AppVersion" name="appversion" data-name="appversion" type="text" />
                </div>
              </div>
              <div class="form-group col-sm-12">
                <label class="col-sm-2 control-label" for="ShowMenuInUserPrivileges1">按权限显示菜单</label>
                <div class="col-sm-10">
                  <label class="checkbox-inline">
                    <input checked="checked" id="ShowMenuInUserPrivileges1" name="showmenuinuserprivileges" data-name="showmenuinuserprivileges" type="radio" value="true" /> 是</label>
                  <label class="checkbox-inline">
                    <input id="ShowMenuInUserPrivileges0" name="showmenuinuserprivileges" data-name="showmenuinuserprivileges" type="radio" value="false" /> 否</label>
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="DataLogEnabled1">数据日志</label>
                <div class="col-sm-10">
                  <label class="checkbox-inline">
                    <input id="DataLogEnabled1" name="datalogenabled" data-name="datalogenabled" type="radio" value="true" /> 启用</label>
                  <label class="checkbox-inline">
                    <input checked="checked" id="DataLogEnabled0" name="datalogenabled" data-name="datalogenabled" type="radio" value="false" /> 禁用</label>
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="LogEnabled1">访问日志</label>
                <div class="col-sm-10">
                  <label class="checkbox-inline">
                    <input id="LogEnabled1" name="LogEnabled" type="radio" value="true" /> 启用</label>
                  <label class="checkbox-inline">
                    <input checked="checked" id="LogEnabled0" name="logenabled" data-name="logenabled" type="radio" value="false" /> 禁用</label>
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="LogEnabled1">登录验证码</label>
                <div class="col-sm-10">
                  <label class="checkbox-inline">
                    <input id="VerifyCodeEnabled1" name="verifycodeenabled" data-name="verifycodeenabled" type="radio" value="true" /> 启用</label>
                  <label class="checkbox-inline">
                    <input checked="checked" id="VerifyCodeEnabled0" name="verifycodeenabled" data-name="verifycodeenabled" type="radio" value="false" /> 禁用</label>
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="loglevel">日志级别</label>
                <div class="col-sm-10">
                  <select class="form-control" name="loglevel" data-name="loglevel" id="loglevel" data-value="1">
                    <option value="1">information</option>
                    <option value="2">warning</option>
                    <option value="3">error</option>
                  </select>
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="MaxFetchRecords">单页最大记录数</label>
                <div class="col-sm-10">
                  <input class="form-control required int" data-range="[1,25000]" id="MaxFetchRecords" name="maxfetchrecords" data-name="maxfetchrecords" type="text" value="100" />
                </div>
              </div>
              <div class="form-group col-sm-12 hide">
                <label class="col-sm-2 control-label" for="CacheEnabled1">是否启用缓存</label>
                <div class="col-sm-10">
                  <label class="checkbox-inline">
                    <input id="CacheEnabled1" name="cacheenabled" data-name="cacheenabled" type="radio" value="true" /> 启用</label>
                  <label class="checkbox-inline">
                    <input checked="checked" id="CacheEnabled0" name="cacheenabled" data-name="cacheenabled" type="radio" value="false" /> 禁用</label>
                </div>
              </div>
              <div class="form-group col-sm-12 text-center" id="form-buttons">
                <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-saved"></span> 保存</button>
                <button type="reset" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> 重置</button>
              </div>
            </form>
          </div>
        </div>

      </div>
      <nav class="navbar navbar-default navbar-fixed-bottom hide" role="navigation" id="body-footer">
        <div class="container">
          <div class="navbar-form navbar-right" id="body-footer-content">
          </div>
        </div>
      </nav>
    </div>
  </div>
</div>

<script src="/content/js/jquery.form.js"></script>
<script src="/content/js/jquery-validate/jquery.validate.min.js"></script>
<script src="/content/js/jquery-validate/localization/messages_zh.min.js"></script>
<script src="/content/js/xms.fillform.js"></script>
<script>
  $(function () {
    //表单验证
    var $form = $("#editform");
    Xms.Web.Form($form, function (response) {
      console.log(response);
      //Xms.Web.Alert(response.IsSuccess, response.Content || response.ErrorMessage);
    });
    $(".xmscheckbox").xmsCheckbox();
    //Xms.Web.SelectedValue($('#loglevel'), $('#loglevel').data('value'));
    loadData();
  });

  function loadData() {
    Xms.Web.GetJson('/api/settings/platform/get', null, function (res) {
      var data = res.Content;
      if(!data) return;
      $('#editform').fillForm(data);
    });
  }
</script>

</body>
</html>